<?php

namespace JsonLowCode\UI;

use JsonLowCode\Schema;
use JsonLowCode\Traits\Props\HasHugeSize;
use JsonLowCode\Traits\Slots\HasSlotExtra;
use JsonLowCode\Traits\Slots\HasSlotIcon;

/**
 * NEmpty 空组件
 * @method static NEmpty make(string $description = null, mixed $children = null) NEmpty组件
 */
class NEmpty extends Schema
{

    protected string $componentName = "NEmpty";

    use HasSlotIcon, HasSlotExtra, HasHugeSize;

    /**
     * @param string|null $description
     * @param mixed|null $children
     */
    public function __construct(string $description = null, mixed $children = null)
    {
        parent::__construct();
        if ($description){
            $this->description($description);
        }
        $this->children($children);
    }

    /**
     * 描述信息
     * @param string $description
     * @return $this
     */
    public function description(string $description): static
    {
        return $this->prop("description",$description);
    }

    /**
     * 是否展示图标
     * @param bool|string $bool
     * @return $this
     */
    public function showIcon(bool|string $bool = true): static
    {
        return $this->prop('show-icon', $bool);
    }

    /**
     * 是否展示描述信息
     * @param bool|string $bool
     * @return $this
     */
    public function showDescription(bool|string $bool = true): static
    {
        return $this->prop('show-description', $bool);
    }

}
